import Vue from 'vue'

/**
 * 用户操作服务
 */
export default {

    /**
     * 更新用户信息
     * @param {*} params userID
     * @param {*} [config={}]
     */
    async updateUserInfo(params, config = {}) {
        let result = await Vue.http.put('/UserInfo/UpdateUserInfo', params, config);
        return result;
    },
    /**
     * 患者注册
     * @param config
     * @returns {Promise.<*>}
     */
    async registerUserInfo(params, config = {}) {
        let result = await Vue.http.post('/UserInfo/RegisterUserInfo', params, config)
        return result
    },
    /**
     * 患者登陆
     * @param config
     * @returns {Promise.<*>}
     */
    async loginTD(params, config = {}) {
        let result = await Vue.http.post('/UserInfo/LoginTD', params, config)
        return result
    },
    /**
     * 根据患者编号获取患者信息
     * @param {*} params 
     * @param {*} config 
     */
    async getUserInfoByID(params = {}, config = {}) {
        config.params = params;
        let result = await Vue.http.get('/UserInfo/GetUserInfoByID', config);
        return result;
    },
    /**
     * 忘记密码
     * @param {*} params 
     * @param {*} config 
     */
    async forgetPassword(params = {}, config = {}) {
        let result = await Vue.http.put('/UserInfo/ForgetPassword', params, config);
        return result;
    },
    /**
     * 修改密码
     * @param {*} [params={}]
     * @param {*} [config={}]
     * @returns
     */
    async updatePassword(params = {}, config = {}) {
        let result = await Vue.http.put('/UserInfo/UpdatePassword', params, config);
        return result;
    }
}